<script lang="ts" setup>
import { ref } from 'vue';

// 完整写法
// const money = ref<number>(10000)
// 简洁写法 建议
const money = ref(10000)
money.value.toFixed(2)

// const car = ref<string>('法拉利')
const car = ref('法拉利')
car.value.trim()
// car.value.toFiexed()

// 复杂类型，不建议缩写
const list = ref<{
    id: number;
    name: string;
    done: boolean
}[]>([])

setTimeout(() => {
    list.value = [
        { id: 1, name: '吃饭', done: false },
        { id: 2, name: '睡觉', done: true }
    ]
}, 1000)
</script>

<template>
    <div>我是vue3-ts</div>
    <div v-for="item in list" :key="item.id">{{item.name}}</div>
</template>